package com.feeyo.monitor.service.imp;

import com.feeyo.monitor.mapper.VehicleEventMapper;
import com.feeyo.monitor.service.VehicleEventService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Author <a href="mailto:bliulei@variflight.com">liulei</a>
 * @Description Created by liulei on 2017/5/18 下午3:31.
 */
@Service
public class VehicleEventServiceImp implements VehicleEventService {

    @Autowired
    VehicleEventMapper vehicleEventMapper;


    @Override
    public PageInfo selectByPage(Map param, int pageNumber, int pageSize) {
        PageHelper.startPage(pageNumber, pageSize);
        List<Map> result = vehicleEventMapper.selectByPage(param);
        PageInfo pi = new PageInfo(result);
        return pi;
    }

    @Override
    public int updateDeleteStatus(Integer eventId) {
        return vehicleEventMapper.updateDeleteStatus(eventId);
    }
}
